import request from '@/utils/request'

// 查询电桩列表
export function listDev(query) {
  return request({
    url: '/equipment/dev/list',
    method: 'get',
    params: query
  })
}

// 查询电桩详细
export function getDev(devId) {
  return request({
    url: '/equipment/dev/' + devId,
    method: 'get'
  })
}
export function getDevSn(sn) {
  return request({
    url: '/equipment/dev/sn/' + sn,
    method: 'get'
  })
}

export function getDevbyQr(qrId) {
  return request({
    url: '/equipment/dev/byQr/' + qrId,
    method: 'get'
  })
}

// 新增电桩
export function addDev(data) {
  return request({
    url: '/equipment/dev',
    method: 'post',
    data: data
  })
}

// 新增电桩
export function batchAddDev(data) {
  return request({
    url: '/equipment/dev/batchAdd',
    method: 'post',
    data: data
  })
}

// 修改电桩
export function updateDev(data) {
  return request({
    url: '/equipment/dev',
    method: 'put',
    data: data
  })
}

// 删除电桩
export function delDev(data) {
  return request({
    url: '/equipment/dev',
    method: 'delete',
    data: data
  })
}

// 设置分档功率
export function getDevPow(sn) {
  return request({
    url: '/equipment/operation/gradePow/' + sn,
    method: 'get'
  })
}


// 设置分档功率
export function setDevPow(data) {
  return request({
    url: '/equipment/operation/gradePow',
    method: 'post',
    data: data
  })
}


// 批量二维码
export function batchGetQr(data) {
  return request({
    url: '/equipment/dev/batchGetQr',
    method: 'post',
    data: data
  })
}
